package com.kuwou.workobject.controller;

import com.kuwou.workobject.pojo.vo.SingerTopThreeVo;
import com.kuwou.workobject.service.SingerListService;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.util.List;

@RequiredArgsConstructor
@RequestMapping("/singerList")
@Controller
public class SingerListController {

    private final SingerListService singerListService;


    /**
     * 获取top3歌手列表
     * @return
     * @throws IOException
     */
    @GetMapping("/getTopThree")
    @ResponseBody
    public List<SingerTopThreeVo> getTopThree() throws IOException {
        return singerListService.getSingerTopThree();
    }

    /**
     * 获取歌手列表
     */
    @GetMapping("/getSingerList")
    @ResponseBody
    public List<String> getSingerList(int pageNum,int pageSize) throws IOException {
        return singerListService.getSingerList(pageNum,pageSize);
    }


}
